package com.isoft.c2team3service2.service.impl;

import com.isoft.c2team3service2.entity.Album;
import com.isoft.c2team3service2.entity.Concert;
import com.isoft.c2team3service2.entity.Plate;
import com.isoft.c2team3service2.mapper.AlbumMapper;
import com.isoft.c2team3service2.mapper.ConcertMapper;
import com.isoft.c2team3service2.mapper.PlateMapper;
import com.isoft.c2team3service2.service.EsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 蓝莓
 * @date 2025/7/4 11:32
 */
@Service
public class EsServiceImpl implements EsService {

    @Autowired
    private AlbumMapper albumMapper;

    @Autowired
    private ConcertMapper concertMapper;

    @Autowired
    private PlateMapper plateMapper;

    @Override
    public Concert getConcert() {
        List<String> categories = concertMapper.se();
        List<Double> tickects =concertMapper.le();
        List<Double> numbers =concertMapper.ec();
        String title  = "不同城市开演唱会的门票的数量（柱状）、总门票收入（折线）";

        return  new Concert(categories, tickects, numbers, title);
    }

    @Override
    public Plate getPlate() {
        List<String> categories = plateMapper.se();
        List<Double> numbers =plateMapper.ec();
        String title  = "各大平台粉丝数量";

        return  new Plate(categories, numbers, title);
    }

    @Override
    public Album getAlbum() {
        List<String> categories = albumMapper.se();
        List<Double> numbers =albumMapper.ec();
        String title = "专辑的销售数量";

        return  new Album(categories, numbers, title);
    }

}
